package com.authorityManagement.mapper;

import com.authorityManagement.entity.Menu;
import com.authorityManagement.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper extends BaseMapper<User> {
      
      @Select("SELECT\n" +
            "DISTINCT m.id,m.menu_name,m.perms,m.path,m.component,m.pid,m.pname,m.type\n" +
            "FROM  \n" +
            "sys_user_role ur JOIN sys_role_menu rm ON ur.role_id=rm.role_id\n" +
            "JOIN sys_menu m ON m.id=rm.menu_id\n" +
            "WHERE\n" +
            "ur.user_id=#{id}\n")
      List<Menu> queryAllAuthorityList(@Param("id") Long id);
}
